{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 编辑行为树EnemyBehaviorTree"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 添加Sequence\n",
    "改名为：FindPlayer\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_1.png)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 添加装饰器\n",
    "添加黑板装饰器Blackboard，改名为HeardPlayer\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_2.png)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 设置黑板装饰器观察值终止为Lower Priority\n",
    "    None，不终止，不进行条件终止\n",
    "    Self，自我终止，可以终止同一个父节点下的Action类型的任务\n",
    "    Lower Priority，低级别终止，设置成低级别终止的任务，具有比其他任务更高级的级别，当该任务条件发生改变时，可以终止其他任务\n",
    "    Both双向终止，self和lower priority一起使用\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_3.png)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 编辑黑板，添加HasHeard\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_4.png)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### HasHeard类型为：Bool\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_4_1.png)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 编辑“黑板装饰器”节点HeardPlayer\n",
    "回到行为树，选择黑板装饰器节点，Blackboard Key选择HasHeard\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_5.png)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 编辑行为树，添加任务 MoveTo、wait\n",
    "    添加任务 MoveTo\n",
    "    添加任务 wait 5秒钟\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_6.png)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## MoveTo 的Blackboard Key改为Player\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_7.png)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 新建任务BTTask_BlueprintBase\n",
    "选BTTask_BlueprintBase\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_8.png)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 任务名称改为ResetBoolTask\n",
    "默认的名称BTTask_BlueprintBase_New改为ResetBoolTask\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_9.png)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 编辑行为树，添加任务，ResetBoolTask\n",
    "添加任务，ResetBoolTask，命名为ClearLocation\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_10.png)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 编辑任务ResetBoolTask\n",
    "    添加变量key，类型选择Blackboard Key Selector，变量设为公有\n",
    "    添加变量value，类型选择Bool，变量设为公有\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_11.png)\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 编辑任务ResetBoolTask\n",
    "添加事件：Receive Execute\n",
    "添加事件：Receive Abort\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_12.png)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 编辑黑板，添加SoundLocation\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_13.png)\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 设为Vector类型\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_13_1.png)\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 编辑行为树MoveTo节点\n",
    "Blackboard Key设置为：SoundLocation\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_14.png)\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 编辑行为树ClearLocation节点\n",
    "    Blackboard Key设置为：HasHeard\n",
    "    如果没有看得到选项，可能是因为任务里面，变量没有设置为公有\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_1_15.png)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 编辑EnemyCharacter"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 选中PawnSensing，\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_2_1.png)\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 选中On Hear Noise\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_2_2.png)\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 编辑OnHear Noise\n",
    "    设置黑板的值，先设置SoundLocation，\n",
    "    再设置HashHeard，Bool Value设为True\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_2_3.png)\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 设置阈值Hearing Threshold\n",
    "    Use Animation Asset(使用动画资源)\n",
    "    hearing Threshold 听阈；听阀；听力障碍；听觉阈限\n",
    "    LOSHearing Threshold 视距 （指朝发生源望去，其间无遮挡的直线距离）\n",
    "    Peripheral Vision Angle 视野范围\n",
    "    Sight Radius 视野半径\n",
    "\n",
    "    到EnemyCharacter里面改！不要在FirstPersonExampleMap关卡里面改！关卡里面只能改具体的敌人，没法影响新产生的敌人\n",
    "    听觉不能太大，要不然没法验证效果LOSHearing Threshold\n",
    "    \n",
    "    选中PawnSensing，设置Hearing Threshold和LOSHearing Threshold\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_3.png)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 编辑firstPersonCharacter，发出声音"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 添加组件PawnNoiseEmitter\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_4_1.png)\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 开枪时发出声音，添加MakeNoise\n",
    "编辑Spawn projectile模块\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0012_4_2.png)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 测试，\n",
    "近了听得到，远了听不到"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "304.475px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
